package cn.xinfei.xdecision.data.core.util;

import cn.xinfei.xdecision.common.model.datax.datamanage.v2.VarDataSourceCallLog;
import cn.xinfei.xdecision.common.utils.util.DateUtils;

public class VarDataSourceCallLogUtil {


    public static VarDataSourceCallLog buildVarDataSourceCallLog(
            long start,
            long end,
            String inputStream,
            String outputStream,
            String requestId,
            String varValues,
            String sourceType,
            String scene,
            Long dataSourceId
    ) {
        VarDataSourceCallLog varDataSourceCallLog = new VarDataSourceCallLog();
        varDataSourceCallLog.setCreateTime(DateUtils.getCurrentDate());
        varDataSourceCallLog.setUpdateTime(DateUtils.getCurrentDate());
        varDataSourceCallLog.setDuration(end - start);
        varDataSourceCallLog.setInputParam(inputStream);
        varDataSourceCallLog.setOutputParam(outputStream);
        varDataSourceCallLog.setRequestId(requestId);
        varDataSourceCallLog.setVarValues(varValues);
        varDataSourceCallLog.setSourceType(sourceType);
        varDataSourceCallLog.setScene(scene);
        varDataSourceCallLog.setDataSourceId(dataSourceId);
        return varDataSourceCallLog;
    }
}
